<div class="data-div" xmlns:th="http://www.w3.org/1999/xhtml">
    <div class="widget-header bordered-bottom bordered-themeprimary">
        <i class="widget-icon fa fa-tasks themeprimary"></i>
        <span class="widget-caption themeprimary">数据列表</span>
        <form  role="form" onsubmit="return false;" id="form_data_table_merchant_par_list_1">
            <input  type="hidden" value="" name="uid" th:value="${user.id}"/>
            <div class="widget-buttons">
                商户名称：<input type="text" name="merchantName" style="width:120px;height:25px;margin-right:10px;padding: 3px;">
                联系人电话：<input type="text" name="linkmanMobile" style="width:120px;height:25px;margin-right:10px;padding: 3px;">
            </div>
            <div class="widget-buttons">
                <button href="javascript:;" class="btn btn-blue btn-xs search"  data-title="查询" data-form="true" onclick="">查询</button>
            </div>

            <div class="widget-buttons buttons-bordered">
                <button href="merchant/add_page" class="btn btn-palegreen btn-xs" data-handler="MODAL" modal-size="90%" data-title="添加商户">新增</button>
            </div>

        </form>
    </div>

    <div class="widget no-header ">
        <div class="widget-body">
            <table class="table table-condensed table-bordered table-hover " id="data_table_merchant_par_list_1">
            </table>

        </div>
    </div>
    <!-- END SAMPLE TABLE PORTLET-->
</div>

<script type="text/javascript">

    $(document).ready(function() {

        //look-up 查询条件 会员
        Select2Ex.handleForm4select2({target:$("#form_data_table_merchant_par_list_1")});

        TableAjax.init('data_table_merchant_par_list_1',{
            sAjaxSource: "merchant/par_list",
            aaSorting: [
                [0, "asc" ]
            ], // 需要自定义
            uxDataTitle:"null",
            uxCheckable:false,
            uxCloseScroll:true,
            uxDrapable:false,
            aoColumns: [
                {sTitle:'序号',  mData: "id",uxLongText:true},
                {sTitle:'商户名称',  mData: "merchantName"},
                {sTitle:'联系人姓名',  mData: "linkmanName"},
                {sTitle:'联系人电话',  mData: "linkmanMobile"},
                {sTitle:'经营类别',  mData: "merchantTypeInfo"},
                {sTitle:'状态',  mData: "disabled",
                    mRender:function(data,d,all){
                        var disable = "";
                        if (all.disabled==0){
                            disable = "<font color='green'>启用</font>";
                        }else if (all.disabled==1){
                            disable = "<font color='red'>禁用</font>";
                        }else {
                            disable = "<font color='red'>未知</font>";
                        }
                        return disable;
                    }
                },
                {sTitle:'返佣比例（%）',  mData: "disabled",
                    mRender:function(data,d,all){
                        if (all.rateReturnCommission==null){
                            return 0;
                        }
                        return all.rateReturnCommission;
                    }
                },
                {sTitle:'操作',
                    mData: "id" ,
                    mRender:function(data,d,all){
                        var html = "";
                        html += '<a class="blue-stripes" style="margin:15px" data-title="全部门店" data-handler="INLINE" href="shop/cur_merchant_list_page?merchantId='+all.id+'" modal-size="99%">全部门店</a>'
                        html += '|'+'<a class="blue-stripes" style="margin:15px" data-title="门店添加" data-handler="MODAL" href="shop/add_page?merchantId='+all.id+'" modal-size="820px">添加门店</a>';
                        html += '|'+'<a class="blue-stripes" style="margin:15px" data-title="支付通道" data-handler="INLINE" href="merchant/pay/channel/par_list_page?merchantId='+all.id+'" modal-size="99%">支付通道</a>';
                        html += '|'+'<a class="blue-stripes" style="margin:15px" data-title="设置返佣比例" data-handler="MODAL" href="merchant/rate_set_page?merchantId='+all.id+'" modal-size="666px">设置返佣比例</a>';
                        return html;
                    }
                }
            ]

        });

    });

</script>